<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-2"></span><span>
</span><span id="line-3"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.CmmToAsm.Reg.Linear.FreeRegs</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-4"></span><span>    </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.FreeRegs.html#FR"><span class="hs-identifier">FR</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-5"></span><span>    </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.FreeRegs.html#maxSpillSlots"><span class="hs-identifier">maxSpillSlots</span></a></span><span>
</span><span id="line-6"></span><span class="hs-special">)</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-10"></span><span class="hs-keyword">where</span><span>
</span><span id="line-11"></span><span>
</span><span id="line-12"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-13"></span><span>
</span><span id="line-14"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Platform.Reg.html"><span class="hs-identifier">GHC.Platform.Reg</span></a></span><span>
</span><span id="line-15"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Platform.Reg.Class.html"><span class="hs-identifier">GHC.Platform.Reg.Class</span></a></span><span>
</span><span id="line-16"></span><span>
</span><span id="line-17"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Config.html"><span class="hs-identifier">GHC.CmmToAsm.Config</span></a></span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Panic.html"><span class="hs-identifier">GHC.Utils.Panic</span></a></span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#"><span class="hs-identifier">GHC.Platform</span></a></span><span>
</span><span id="line-20"></span><span>
</span><span id="line-21"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-22"></span><span class="hs-comment">-- The free register set</span><span>
</span><span id="line-23"></span><span class="hs-comment">-- This needs to be *efficient*</span><span>
</span><span id="line-24"></span><span class="hs-comment">-- Here's an inefficient 'executable specification' of the FreeRegs data type:</span><span>
</span><span id="line-25"></span><span class="hs-comment">--</span><span>
</span><span id="line-26"></span><span class="hs-comment">--      type FreeRegs = [RegNo]</span><span>
</span><span id="line-27"></span><span class="hs-comment">--      noFreeRegs = 0</span><span>
</span><span id="line-28"></span><span class="hs-comment">--      releaseReg n f = if n `elem` f then f else (n : f)</span><span>
</span><span id="line-29"></span><span class="hs-comment">--      initFreeRegs = allocatableRegs</span><span>
</span><span id="line-30"></span><span class="hs-comment">--      getFreeRegs cls f = filter ( (==cls) . regClass . RealReg ) f</span><span>
</span><span id="line-31"></span><span class="hs-comment">--      allocateReg f r = filter (/= r) f</span><span>
</span><span id="line-32"></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.PPC.html"><span class="hs-identifier">GHC.CmmToAsm.Reg.Linear.PPC</span></a></span><span>    </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">PPC</span></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.SPARC.html"><span class="hs-identifier">GHC.CmmToAsm.Reg.Linear.SPARC</span></a></span><span>  </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">SPARC</span></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.X86.html"><span class="hs-identifier">GHC.CmmToAsm.Reg.Linear.X86</span></a></span><span>    </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">X86</span></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.X86_64.html"><span class="hs-identifier">GHC.CmmToAsm.Reg.Linear.X86_64</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">X86_64</span></span><span>
</span><span id="line-37"></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.PPC.Instr.html"><span class="hs-identifier">GHC.CmmToAsm.PPC.Instr</span></a></span><span>   </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">PPC.Instr</span></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.SPARC.Instr.html"><span class="hs-identifier">GHC.CmmToAsm.SPARC.Instr</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">SPARC.Instr</span></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.X86.Instr.html"><span class="hs-identifier">GHC.CmmToAsm.X86.Instr</span></a></span><span>   </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">X86.Instr</span></span><span>
</span><span id="line-41"></span><span>
</span><span id="line-42"></span><span class="hs-keyword">class</span><span> </span><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681031580"><span class="hs-identifier hs-type">freeRegs</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="FR"><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.FreeRegs.html#FR"><span class="hs-identifier hs-var">FR</span></a></span></span><span> </span><span id="local-6989586621681031580"><span class="annot"><a href="#local-6989586621681031580"><span class="hs-identifier hs-type">freeRegs</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-43"></span><span>    </span><span id="frAllocateReg"><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.FreeRegs.html#frAllocateReg"><span class="hs-identifier hs-type">frAllocateReg</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Platform.Reg.html#RealReg"><span class="hs-identifier hs-type">RealReg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681031580"><span class="hs-identifier hs-type">freeRegs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681031580"><span class="hs-identifier hs-type">freeRegs</span></a></span><span>
</span><span id="line-44"></span><span>    </span><span id="frGetFreeRegs"><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.FreeRegs.html#frGetFreeRegs"><span class="hs-identifier hs-type">frGetFreeRegs</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Platform.Reg.Class.html#RegClass"><span class="hs-identifier hs-type">RegClass</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681031580"><span class="hs-identifier hs-type">freeRegs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Platform.Reg.html#RealReg"><span class="hs-identifier hs-type">RealReg</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-45"></span><span>    </span><span id="frInitFreeRegs"><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.FreeRegs.html#frInitFreeRegs"><span class="hs-identifier hs-type">frInitFreeRegs</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681031580"><span class="hs-identifier hs-type">freeRegs</span></a></span><span>
</span><span id="line-46"></span><span>    </span><span id="frReleaseReg"><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.FreeRegs.html#frReleaseReg"><span class="hs-identifier hs-type">frReleaseReg</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Platform.Reg.html#RealReg"><span class="hs-identifier hs-type">RealReg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681031580"><span class="hs-identifier hs-type">freeRegs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681031580"><span class="hs-identifier hs-type">freeRegs</span></a></span><span>
</span><span id="line-47"></span><span>
</span><span id="line-48"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.FreeRegs.html#FR"><span class="hs-identifier hs-type">FR</span></a></span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.X86.html#FreeRegs"><span class="hs-identifier hs-type">X86.FreeRegs</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-49"></span><span>    </span><span id="local-6989586621681031549"><span class="annot"><span class="annottext">frAllocateReg :: Platform -&gt; RealReg -&gt; FreeRegs -&gt; FreeRegs
</span><a href="#local-6989586621681031549"><span class="hs-identifier hs-var hs-var hs-var hs-var">frAllocateReg</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">RealReg -&gt; FreeRegs -&gt; FreeRegs
</span><a href="GHC.CmmToAsm.Reg.Linear.X86.html#allocateReg"><span class="hs-identifier hs-var">X86.allocateReg</span></a></span><span>
</span><span id="line-50"></span><span>    </span><span id="local-6989586621681031547"><span class="annot"><span class="annottext">frGetFreeRegs :: Platform -&gt; RegClass -&gt; FreeRegs -&gt; [RealReg]
</span><a href="#local-6989586621681031547"><span class="hs-identifier hs-var hs-var hs-var hs-var">frGetFreeRegs</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; RegClass -&gt; FreeRegs -&gt; [RealReg]
</span><a href="GHC.CmmToAsm.Reg.Linear.X86.html#getFreeRegs"><span class="hs-identifier hs-var">X86.getFreeRegs</span></a></span><span>
</span><span id="line-51"></span><span>    </span><span id="local-6989586621681031545"><span class="annot"><span class="annottext">frInitFreeRegs :: Platform -&gt; FreeRegs
</span><a href="#local-6989586621681031545"><span class="hs-identifier hs-var hs-var hs-var hs-var">frInitFreeRegs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; FreeRegs
</span><a href="GHC.CmmToAsm.Reg.Linear.X86.html#initFreeRegs"><span class="hs-identifier hs-var">X86.initFreeRegs</span></a></span><span>
</span><span id="line-52"></span><span>    </span><span id="local-6989586621681031543"><span class="annot"><span class="annottext">frReleaseReg :: Platform -&gt; RealReg -&gt; FreeRegs -&gt; FreeRegs
</span><a href="#local-6989586621681031543"><span class="hs-identifier hs-var hs-var hs-var hs-var">frReleaseReg</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">RealReg -&gt; FreeRegs -&gt; FreeRegs
</span><a href="GHC.CmmToAsm.Reg.Linear.X86.html#releaseReg"><span class="hs-identifier hs-var">X86.releaseReg</span></a></span><span>
</span><span id="line-53"></span><span>
</span><span id="line-54"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.FreeRegs.html#FR"><span class="hs-identifier hs-type">FR</span></a></span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.X86_64.html#FreeRegs"><span class="hs-identifier hs-type">X86_64.FreeRegs</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-55"></span><span>    </span><span id="local-6989586621681031533"><span class="annot"><span class="annottext">frAllocateReg :: Platform -&gt; RealReg -&gt; FreeRegs -&gt; FreeRegs
</span><a href="#local-6989586621681031533"><span class="hs-identifier hs-var hs-var hs-var hs-var">frAllocateReg</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">RealReg -&gt; FreeRegs -&gt; FreeRegs
</span><a href="GHC.CmmToAsm.Reg.Linear.X86_64.html#allocateReg"><span class="hs-identifier hs-var">X86_64.allocateReg</span></a></span><span>
</span><span id="line-56"></span><span>    </span><span id="local-6989586621681031531"><span class="annot"><span class="annottext">frGetFreeRegs :: Platform -&gt; RegClass -&gt; FreeRegs -&gt; [RealReg]
</span><a href="#local-6989586621681031531"><span class="hs-identifier hs-var hs-var hs-var hs-var">frGetFreeRegs</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; RegClass -&gt; FreeRegs -&gt; [RealReg]
</span><a href="GHC.CmmToAsm.Reg.Linear.X86_64.html#getFreeRegs"><span class="hs-identifier hs-var">X86_64.getFreeRegs</span></a></span><span>
</span><span id="line-57"></span><span>    </span><span id="local-6989586621681031529"><span class="annot"><span class="annottext">frInitFreeRegs :: Platform -&gt; FreeRegs
</span><a href="#local-6989586621681031529"><span class="hs-identifier hs-var hs-var hs-var hs-var">frInitFreeRegs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; FreeRegs
</span><a href="GHC.CmmToAsm.Reg.Linear.X86_64.html#initFreeRegs"><span class="hs-identifier hs-var">X86_64.initFreeRegs</span></a></span><span>
</span><span id="line-58"></span><span>    </span><span id="local-6989586621681031527"><span class="annot"><span class="annottext">frReleaseReg :: Platform -&gt; RealReg -&gt; FreeRegs -&gt; FreeRegs
</span><a href="#local-6989586621681031527"><span class="hs-identifier hs-var hs-var hs-var hs-var">frReleaseReg</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">RealReg -&gt; FreeRegs -&gt; FreeRegs
</span><a href="GHC.CmmToAsm.Reg.Linear.X86_64.html#releaseReg"><span class="hs-identifier hs-var">X86_64.releaseReg</span></a></span><span>
</span><span id="line-59"></span><span>
</span><span id="line-60"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.FreeRegs.html#FR"><span class="hs-identifier hs-type">FR</span></a></span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#FreeRegs"><span class="hs-identifier hs-type">PPC.FreeRegs</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-61"></span><span>    </span><span id="local-6989586621681031517"><span class="annot"><span class="annottext">frAllocateReg :: Platform -&gt; RealReg -&gt; FreeRegs -&gt; FreeRegs
</span><a href="#local-6989586621681031517"><span class="hs-identifier hs-var hs-var hs-var hs-var">frAllocateReg</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">RealReg -&gt; FreeRegs -&gt; FreeRegs
</span><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#allocateReg"><span class="hs-identifier hs-var">PPC.allocateReg</span></a></span><span>
</span><span id="line-62"></span><span>    </span><span id="local-6989586621681031515"><span class="annot"><span class="annottext">frGetFreeRegs :: Platform -&gt; RegClass -&gt; FreeRegs -&gt; [RealReg]
</span><a href="#local-6989586621681031515"><span class="hs-identifier hs-var hs-var hs-var hs-var">frGetFreeRegs</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">RegClass -&gt; FreeRegs -&gt; [RealReg]
</span><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#getFreeRegs"><span class="hs-identifier hs-var">PPC.getFreeRegs</span></a></span><span>
</span><span id="line-63"></span><span>    </span><span id="local-6989586621681031513"><span class="annot"><span class="annottext">frInitFreeRegs :: Platform -&gt; FreeRegs
</span><a href="#local-6989586621681031513"><span class="hs-identifier hs-var hs-var hs-var hs-var">frInitFreeRegs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; FreeRegs
</span><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#initFreeRegs"><span class="hs-identifier hs-var">PPC.initFreeRegs</span></a></span><span>
</span><span id="line-64"></span><span>    </span><span id="local-6989586621681031511"><span class="annot"><span class="annottext">frReleaseReg :: Platform -&gt; RealReg -&gt; FreeRegs -&gt; FreeRegs
</span><a href="#local-6989586621681031511"><span class="hs-identifier hs-var hs-var hs-var hs-var">frReleaseReg</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">RealReg -&gt; FreeRegs -&gt; FreeRegs
</span><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#releaseReg"><span class="hs-identifier hs-var">PPC.releaseReg</span></a></span><span>
</span><span id="line-65"></span><span>
</span><span id="line-66"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.FreeRegs.html#FR"><span class="hs-identifier hs-type">FR</span></a></span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.SPARC.html#FreeRegs"><span class="hs-identifier hs-type">SPARC.FreeRegs</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-67"></span><span>    </span><span id="local-6989586621681031501"><span class="annot"><span class="annottext">frAllocateReg :: Platform -&gt; RealReg -&gt; FreeRegs -&gt; FreeRegs
</span><a href="#local-6989586621681031501"><span class="hs-identifier hs-var hs-var hs-var hs-var">frAllocateReg</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; RealReg -&gt; FreeRegs -&gt; FreeRegs
</span><a href="GHC.CmmToAsm.Reg.Linear.SPARC.html#allocateReg"><span class="hs-identifier hs-var">SPARC.allocateReg</span></a></span><span>
</span><span id="line-68"></span><span>    </span><span id="local-6989586621681031499"><span class="annot"><span class="annottext">frGetFreeRegs :: Platform -&gt; RegClass -&gt; FreeRegs -&gt; [RealReg]
</span><a href="#local-6989586621681031499"><span class="hs-identifier hs-var hs-var hs-var hs-var">frGetFreeRegs</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">RegClass -&gt; FreeRegs -&gt; [RealReg]
</span><a href="GHC.CmmToAsm.Reg.Linear.SPARC.html#getFreeRegs"><span class="hs-identifier hs-var">SPARC.getFreeRegs</span></a></span><span>
</span><span id="line-69"></span><span>    </span><span id="local-6989586621681031497"><span class="annot"><span class="annottext">frInitFreeRegs :: Platform -&gt; FreeRegs
</span><a href="#local-6989586621681031497"><span class="hs-identifier hs-var hs-var hs-var hs-var">frInitFreeRegs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; FreeRegs
</span><a href="GHC.CmmToAsm.Reg.Linear.SPARC.html#initFreeRegs"><span class="hs-identifier hs-var">SPARC.initFreeRegs</span></a></span><span>
</span><span id="line-70"></span><span>    </span><span id="local-6989586621681031495"><span class="annot"><span class="annottext">frReleaseReg :: Platform -&gt; RealReg -&gt; FreeRegs -&gt; FreeRegs
</span><a href="#local-6989586621681031495"><span class="hs-identifier hs-var hs-var hs-var hs-var">frReleaseReg</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; RealReg -&gt; FreeRegs -&gt; FreeRegs
</span><a href="GHC.CmmToAsm.Reg.Linear.SPARC.html#releaseReg"><span class="hs-identifier hs-var">SPARC.releaseReg</span></a></span><span>
</span><span id="line-71"></span><span>
</span><span id="line-72"></span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.FreeRegs.html#maxSpillSlots"><span class="hs-identifier hs-type">maxSpillSlots</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Config.html#NCGConfig"><span class="hs-identifier hs-type">NCGConfig</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-73"></span><span id="maxSpillSlots"><span class="annot"><span class="annottext">maxSpillSlots :: NCGConfig -&gt; Int
</span><a href="GHC.CmmToAsm.Reg.Linear.FreeRegs.html#maxSpillSlots"><span class="hs-identifier hs-var hs-var">maxSpillSlots</span></a></span></span><span> </span><span id="local-6989586621681031493"><span class="annot"><span class="annottext">NCGConfig
</span><a href="#local-6989586621681031493"><span class="hs-identifier hs-var">config</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Arch
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformArch"><span class="hs-identifier hs-var">platformArch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NCGConfig -&gt; Platform
</span><a href="GHC.CmmToAsm.Config.html#ncgPlatform"><span class="hs-identifier hs-var hs-var">ncgPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">NCGConfig
</span><a href="#local-6989586621681031493"><span class="hs-identifier hs-var">config</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-74"></span><span>   </span><span class="annot"><span class="annottext">Arch
</span><a href="../../ghc-boot/src/GHC.Platform.html#ArchX86"><span class="hs-identifier hs-var">ArchX86</span></a></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NCGConfig -&gt; Int
</span><a href="GHC.CmmToAsm.X86.Instr.html#maxSpillSlots"><span class="hs-identifier hs-var">X86.Instr.maxSpillSlots</span></a></span><span> </span><span class="annot"><span class="annottext">NCGConfig
</span><a href="#local-6989586621681031493"><span class="hs-identifier hs-var">config</span></a></span><span>
</span><span id="line-75"></span><span>   </span><span class="annot"><span class="annottext">Arch
</span><a href="../../ghc-boot/src/GHC.Platform.html#ArchX86_64"><span class="hs-identifier hs-var">ArchX86_64</span></a></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NCGConfig -&gt; Int
</span><a href="GHC.CmmToAsm.X86.Instr.html#maxSpillSlots"><span class="hs-identifier hs-var">X86.Instr.maxSpillSlots</span></a></span><span> </span><span class="annot"><span class="annottext">NCGConfig
</span><a href="#local-6989586621681031493"><span class="hs-identifier hs-var">config</span></a></span><span>
</span><span id="line-76"></span><span>   </span><span class="annot"><span class="annottext">Arch
</span><a href="../../ghc-boot/src/GHC.Platform.html#ArchPPC"><span class="hs-identifier hs-var">ArchPPC</span></a></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NCGConfig -&gt; Int
</span><a href="GHC.CmmToAsm.PPC.Instr.html#maxSpillSlots"><span class="hs-identifier hs-var">PPC.Instr.maxSpillSlots</span></a></span><span> </span><span class="annot"><span class="annottext">NCGConfig
</span><a href="#local-6989586621681031493"><span class="hs-identifier hs-var">config</span></a></span><span>
</span><span id="line-77"></span><span>   </span><span class="annot"><span class="annottext">Arch
</span><a href="../../ghc-boot/src/GHC.Platform.html#ArchS390X"><span class="hs-identifier hs-var">ArchS390X</span></a></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; Int
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;maxSpillSlots ArchS390X&quot;</span></span><span>
</span><span id="line-78"></span><span>   </span><span class="annot"><span class="annottext">Arch
</span><a href="../../ghc-boot/src/GHC.Platform.html#ArchSPARC"><span class="hs-identifier hs-var">ArchSPARC</span></a></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NCGConfig -&gt; Int
</span><a href="GHC.CmmToAsm.SPARC.Stack.html#maxSpillSlots"><span class="hs-identifier hs-var">SPARC.Instr.maxSpillSlots</span></a></span><span> </span><span class="annot"><span class="annottext">NCGConfig
</span><a href="#local-6989586621681031493"><span class="hs-identifier hs-var">config</span></a></span><span>
</span><span id="line-79"></span><span>   </span><span class="annot"><span class="annottext">Arch
</span><a href="../../ghc-boot/src/GHC.Platform.html#ArchSPARC64"><span class="hs-identifier hs-var">ArchSPARC64</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; Int
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;maxSpillSlots ArchSPARC64&quot;</span></span><span>
</span><span id="line-80"></span><span>   </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#ArchARM"><span class="hs-identifier hs-type">ArchARM</span></a></span><span> </span><span class="annot"><span class="annottext">ArmISA
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[ArmISAExt]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ArmABI
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; Int
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;maxSpillSlots ArchARM&quot;</span></span><span>
</span><span id="line-81"></span><span>   </span><span class="annot"><span class="annottext">Arch
</span><a href="../../ghc-boot/src/GHC.Platform.html#ArchAArch64"><span class="hs-identifier hs-var">ArchAArch64</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; Int
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;maxSpillSlots ArchAArch64&quot;</span></span><span>
</span><span id="line-82"></span><span>   </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#ArchPPC_64"><span class="hs-identifier hs-type">ArchPPC_64</span></a></span><span> </span><span class="annot"><span class="annottext">PPC_64ABI
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NCGConfig -&gt; Int
</span><a href="GHC.CmmToAsm.PPC.Instr.html#maxSpillSlots"><span class="hs-identifier hs-var">PPC.Instr.maxSpillSlots</span></a></span><span> </span><span class="annot"><span class="annottext">NCGConfig
</span><a href="#local-6989586621681031493"><span class="hs-identifier hs-var">config</span></a></span><span>
</span><span id="line-83"></span><span>   </span><span class="annot"><span class="annottext">Arch
</span><a href="../../ghc-boot/src/GHC.Platform.html#ArchAlpha"><span class="hs-identifier hs-var">ArchAlpha</span></a></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; Int
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;maxSpillSlots ArchAlpha&quot;</span></span><span>
</span><span id="line-84"></span><span>   </span><span class="annot"><span class="annottext">Arch
</span><a href="../../ghc-boot/src/GHC.Platform.html#ArchMipseb"><span class="hs-identifier hs-var">ArchMipseb</span></a></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; Int
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;maxSpillSlots ArchMipseb&quot;</span></span><span>
</span><span id="line-85"></span><span>   </span><span class="annot"><span class="annottext">Arch
</span><a href="../../ghc-boot/src/GHC.Platform.html#ArchMipsel"><span class="hs-identifier hs-var">ArchMipsel</span></a></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; Int
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;maxSpillSlots ArchMipsel&quot;</span></span><span>
</span><span id="line-86"></span><span>   </span><span class="annot"><span class="annottext">Arch
</span><a href="../../ghc-boot/src/GHC.Platform.html#ArchJavaScript"><span class="hs-identifier hs-var">ArchJavaScript</span></a></span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; Int
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;maxSpillSlots ArchJavaScript&quot;</span></span><span>
</span><span id="line-87"></span><span>   </span><span class="annot"><span class="annottext">Arch
</span><a href="../../ghc-boot/src/GHC.Platform.html#ArchUnknown"><span class="hs-identifier hs-var">ArchUnknown</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; Int
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;maxSpillSlots ArchUnknown&quot;</span></span><span>
</span><span id="line-88"></span></pre></body></html>